#include<bits/stdc++.h>
#define ONLINE_JUDGE
#define ll long long
#define ull unsigned long long
using namespace std;

const ll N = 1e6 + 10, INF = 0x3f3f3f3f, MOD = 998244353;

ll n;

ll ksm(ll a, ll b)
{
    ll res = 1;
    while (b) {
        if (b & 1) res = res * a % MOD;
        a = a * a % MOD, b >>= 1;
    }
    return res;
}

void solve()
{
    ll sum = 0;
    cin >> n;
    for (ll i = 1;i <= n;i++) {
        ll x;cin >> x;
        sum = (sum + x) % MOD;
    }

    cout << sum * ksm(n, MOD - 2) % MOD;
}

signed main()
{
    // ios::sync_with_stdio(0);
    // cin.tie(0);cout.tie(0);
#ifndef ONLINE_JUDGE
    std::istringstream in(R"()");
    std::cin.rdbuf(in.rdbuf());
#endif
    ll T = 1;
    //cin>>T;
    for (ll i = 1;i <= T;i++) {
        solve();
    }
}